#ifndef SUDOKUHOUSE_H_
#define SUDOKUHOUSE_H_

#include "SudokuCellSet.h"
#include "SudokuMethodType.h"
#include <QPair>
#include <QBitArray>

class SudokuData;

class SudokuHouse : public SudokuCellSet
{

public:
    SudokuHouse(SetType type, SudokuData* parentData);

    void sortByCandidatesAmount();

    /**
      * @param candidate Zero based candidate index.
      */
    //TODO change it to return list of indexes
    SudokuCellSet getCellsWithCandidate(int candidate) const;

    /**
      * @return QBitArray with size equal to house length with true if candidate is possible for cell at that index
      */
    QBitArray getCellsArrayWithCandidate(int candidate) const;

    QVector<int> getCandidateCountVector() const;
    /**
      * @return QList with pairs. In pair first number is candidate count, second is zero based candidate index
      */
    QList< QPair<int, int> > getCandidateListByCount() const;

    int eliminate(int num, CellFillerTypes method, int omitColInd, int omitRowInd, int omitBoxInd);
    /**
      * numList contains numbers indexed from 0
      */
    //TODO change omitCells to list of indexes
    int eliminate(QList<int> numList, CellFillerTypes method, SudokuCellSet& omitCells);
    //int eliminateAll(QList<int> omitNumbers, CellFillerTypes method);

    /**
      * Eliminates from cells from cellIndexList all candidates except those from candidateList
      */
    int eliminateAllOthers(QList<int>& cellIndexList, QList<int>& candidateList, CellFillerTypes method);

    /**
      * For sorting
      */
    static bool sortPairs(const QPair<int, int>& pair1, const QPair<int, int>& pair2);



private:
    SudokuData* mParentData;

};

#endif /*SUDOKUHOUSE_H_*/
